package com.gh.ggkt.activity.controller;


import com.atguigu.ggkt.model.order.OrderInfo;
import com.atguigu.ggkt.vo.order.OrderInfoQueryVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gh.Result;
import com.gh.ggkt.activity.service.OrderInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * <p>
 * 订单表 订单表 前端控制器
 * </p>
 *
 * @author Eric Fang
 * @since 2022-09-18
 */
@RestController
@RequestMapping("/admin/order/order-info")
public class OrderInfoController {

    @Autowired
    private OrderInfoService orderInfoService;

    @PostMapping("/{page}/{limit}")
    public Result pageList(@PathVariable Long page,
                           @PathVariable Long limit,
                           @RequestBody OrderInfoQueryVo orderInfoQueryVo) {
        Page<OrderInfo> pageParam = new Page<>(page, limit);
        Map<String, Object> map = orderInfoService.pageList(pageParam, orderInfoQueryVo);
        return Result.ok(map);
    }

}

